import request from '@/utils/request'

const {
    get: $get,
    post: $post,
    delete: $delete,
    download: $download
} = request

// 查询危险源全部
export const riskSourceList = data => {
    return $get('/risk/riskSource/list', data)
}

// 查询危险源列表
export const riskSourcePage = data => {
    return $get('/risk/riskSource/page', data)
}

// 新增危险源
export const riskSourceAdd = data => {
    return $post('/risk/riskSource/add', data)
}

// 查询危险源详情
export const riskSourceDetail = id => {
    return $get('/risk/riskSource/detail/'+ id)
}

// 更新危险源
export const riskSourceUpdate = data => {
    return $post('/risk/riskSource/update', data)
}

// 删除危险源
export const riskSourceDelete = id => {
    return $post('/risk/riskSource/delete/'+ id)
}

// 导出危险源
export const riskSourceExport = (data,fileName) => {
    return $download('/risk/riskSource/export',data, fileName)
}


// 下载模板
export const riskSourceTemplate = (data,filename) => {
  return $download('/risk/riskSource/template',data, filename)
}

// 导入
export const riskSourceImport = (formData) => {
  return $post('/risk/riskSource/import', formData)
}
